Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT ImageCodec;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __IMAGECODEC__}
{$SETC __IMAGECODEC__ := 1}
{$I+}
{$SETC ImageCodecIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __TYPES__}
{$I Types.p}
{$ENDC}
{ ConditionalMacros.p }
{$IFC UNDEFINED __QUICKDRAW__}
{$I Quickdraw.p}
{$ENDC}
{ MixedMode.p }
{ QuickdrawText.p }
{$IFC UNDEFINED __QDOFFSCREEN__}
{$I QDOffscreen.p}
{$ENDC}
{ Errors.p }
{$IFC UNDEFINED __WINDOWS__}
{$I Windows.p}
{$ENDC}
{ Memory.p }
{ Events.p }
{ OSUtils.p }
{ Controls.p }
{ Menus.p }
{$IFC UNDEFINED __IMAGECOMPRESSION__}
{$I ImageCompression.p}
{$ENDC}
{ Components.p }
{ StandardFile.p }
{ Dialogs.p }
{ TextEdit.p }
{ Files.p }
{$IFC UNDEFINED __MOVIES__}
{$I Movies.p}
{$ENDC}
{ Aliases.p }
{ AppleTalk.p }
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
CONST
codecGetCodecInfo = $00;
codecGetCompressionTime = $01;
codecGetMaxCompressionSize = $02;
codecPreCompress = $03;
codecBandCompress = $04;
codecPreDecompress = $05;
codecBandDecompress = $06;
codecCDSequenceBusy = $07;
codecGetCompressedImageSize = $08;
codecGetSimilarity = $09;
codecTrimImage = $0A;
codecRequestSettings = $0B;
codecGetSettings = $0C;
codecSetSettings = $0D;
codecCDSequenceFlush = $0E;
codecSetTimeCode = $0F;
codecCanScale = 1 * (2**(0));
codecCanMask = 1 * (2**(1));
codecCanMatte = 1 * (2**(2));
codecCanTransform = 1 * (2**(3));
codecCanTransferMode = 1 * (2**(4));
codecCanCopyPrev = 1 * (2**(5));
codecCanSpool = 1 * (2**(6));
codecCanClipVertical = 1 * (2**(7));
codecCanClipRectangular = 1 * (2**(8));
codecCanRemapColor = 1 * (2**(9));
codecCanFastDither = 1 * (2**(10));
codecCanSrcExtract = 1 * (2**(11));
codecCanCopyPrevComp = 1 * (2**(12));
codecCanAsync = 1 * (2**(13));
codecCanMakeMask = 1 * (2**(14));
codecCanShift = 1 * (2**(15));
codecCanAsyncWhen = 1 * (2**(16));
codecCanShieldCursor = 1 * (2**(17));
codecCanManagePrevBuffer = 1 * (2**(18));
TYPE
CodecCapabilities = RECORD
flags: LONGINT;
wantedPixelSize: INTEGER;
extendWidth: INTEGER;
extendHeight: INTEGER;
bandMin: INTEGER;
bandInc: INTEGER;
pad: INTEGER;
time: LONGINT;
END;
CONST
codecConditionFirstBand = 1 * (2**(0));
codecConditionLastBand = 1 * (2**(1));
codecConditionFirstFrame = 1 * (2**(2));
codecConditionNewDepth = 1 * (2**(3));
codecConditionNewTransform = 1 * (2**(4));
codecConditionNewSrcRect = 1 * (2**(5));
codecConditionNewMask = 1 * (2**(6));
codecConditionNewMatte = 1 * (2**(7));
codecConditionNewTransferMode = 1 * (2**(8));
codecConditionNewClut = 1 * (2**(9));
codecConditionNewAccuracy = 1 * (2**(10));
codecConditionNewDestination = 1 * (2**(11));
codecConditionFirstScreen = 1 * (2**(12));
codecConditionDoCursor = 1 * (2**(13));
codecConditionCatchUpDiff = 1 * (2**(14));
codecConditionCodecChangedMask = 1 * (2**(31));
codecInfoResourceType = 'cdci';
codecInterfaceVersion = 2;
TYPE
CodecCompressParams = RECORD
sequenceID: ImageSequence;
imageDescription: ImageDescriptionHandle;
data: Ptr;
bufferSize: LONGINT;
frameNumber: LONGINT;
startLine: LONGINT;
stopLine: LONGINT;
conditionFlags: LONGINT;
callerFlags: CodecFlags;
capabilities: ^CodecCapabilities;
progressProcRecord: ICMProgressProcRecord;
completionProcRecord: ICMCompletionProcRecord;
flushProcRecord: ICMFlushProcRecord;
srcPixMap: PixMap;
prevPixMap: PixMap;
spatialQuality: CodecQ;
temporalQuality: CodecQ;
similarity: Fixed;
dataRateParams: DataRateParamsPtr;
reserved: LONGINT;
END;
CodecDecompressParams = RECORD
sequenceID: ImageSequence;
imageDescription: ImageDescriptionHandle;
data: Ptr;
bufferSize: LONGINT;
frameNumber: LONGINT;
startLine: LONGINT;
stopLine: LONGINT;
conditionFlags: LONGINT;
callerFlags: CodecFlags;
capabilities: ^CodecCapabilities;
progressProcRecord: ICMProgressProcRecord;
completionProcRecord: ICMCompletionProcRecord;
dataProcRecord: ICMDataProcRecord;
port: CGrafPtr;
dstPixMap: PixMap;
maskBits: BitMapPtr;
mattePixMap: PixMapPtr;
srcRect: Rect;
matrix: ^MatrixRecord;
accuracy: CodecQ;
transferMode: INTEGER;
frameTime: ICMFrameTimePtr;
reserved: ARRAY [0..0] OF LONGINT;
matrixFlags: SInt8;
matrixType: SInt8;
dstRect: Rect;
END;
CONST
matrixFlagScale2x = 1 * (2**(7));
FUNCTION CDGetCodecInfo(storage: Handle; VAR info: CodecInfo): ComponentResult;
FUNCTION CDGetCompressionTime(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ; VAR time: LONGINT): ComponentResult;
FUNCTION CDGetMaxCompressionSize(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; quality: CodecQ; VAR size: LONGINT): ComponentResult;
FUNCTION CDPreCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
FUNCTION CDBandCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
FUNCTION CDPreDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
FUNCTION CDBandDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
FUNCTION CDCodecBusy(storage: Handle; seq: ImageSequence): ComponentResult;
FUNCTION CDGetCompressedImageSize(storage: Handle; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; VAR dataSize: LONGINT): ComponentResult;
FUNCTION CDGetSimilarity(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; VAR similarity: Fixed): ComponentResult;